package spring.demo.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import spring.demo.bean.User;
import spring.demo.mapper.UserMapper;
import spring.demo.service.UserService;

import java.util.List;

@Service
//该处一定要写 不然最后会报错
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;
    @Override
    public String login(String username, String password) {
        return userMapper.login(username, password);
    }

    @Override
    public List<User> findAll() {
        return userMapper.findAll();
    }

    @Override
    public int deleteById(int id) {
        return userMapper.deleteById(id);
    }

    @Override
    public int add(User user) {
        return userMapper.add(user);
    }
}
